package Extended;

import java.io.*;


public class ColorTangramProgressFilter implements FilenameFilter
{
	public boolean accept(File f, String n)
	{
		return ColorTangramProgress(f.getPath() + "/" + n);
	}

	public static boolean ColorTangramProgress(String Path)
	{
		try
		{
			File ThisFile = new File(Path);
			BufferedReader br;
			String ln;

			if(ThisFile.exists() && ThisFile.canRead())
				if(ThisFile.isFile())
				{
					br = new BufferedReader(new FileReader(ThisFile));

					ln = br.readLine();

					br.close();

					return !(ln == null || !ln.equals("ColorTangram Progress"));
				}
				else
					return ThisFile.isDirectory();
			else
				return false;
		}
		catch(Exception e)
		{
			return false;
		}
	}
}
